/* 
 * File:   Nivel.h
 * Author: agu
 *
 * Created on 7 de junio de 2014, 18:54
 */

#ifndef NIVEL_H
#define	NIVEL_H
#include <gtkmm-3.0/gtkmm.h>
#include <string>
#include <vector>
using std::string;
using std::vector;
class Nivel {
public:
    Nivel();
    Nivel(unsigned int id, const string diff, int minPlayer);
    unsigned int getId();
    string getName();
    string getTileMap();
    void incrementMapWidth();
    void incrementMapHeight();
    unsigned int getMapWidth();
    unsigned int getMapHeight();
    void setMapWidth(unsigned int width);
    void setMapHeight(unsigned int height);
    bool checkDimension();
    bool validate(string& msjError);
    void setMap(Gtk::Grid *grid);
    void setName(const string name);
    void setSizeMap(const string sizeName);
    void setTileMap(const string tileMap);
    void save();
    void reset();
    
    vector<string> getInfo();
    void loadGridMap( Gtk::Grid *grid);
    virtual ~Nivel();
private:
    bool checkHeight();
    bool checkWidth();
    bool validateNumberEnemys();
    bool validateNumberPlants();
    bool validateNumberPlayers();
    string transformMap(const string map);
    string nameToCode(const string name);
    string codeToName(const string code);
    unsigned int id;
    string name;
    string difficult;
    string tileMap;
    string spawn;
    unsigned int width,height;
    unsigned int numPlayers,numPlants, minPlayers;
    unsigned int numZombieR,numZombieG,numZombieB;
    static const int minHeight = 3, minWidth = 3,minEnemys=3,minPlants=0;
    static const int maxHeight = 20, maxWidth = 20,maxPlayers= 5, maxEnemys=5, maxPlants=4;
   
};

#endif	/* NIVEL_H */

